﻿using Dapper;
using SqlKata;
using SqlKata.Compilers;
using Zws.Dapper.Interfaces;

namespace Zws.Dapper.Implements.SqlCompiler
{
    public class MySqlCompilerWrapper : MySqlCompiler, ISqlCompiler
    {
        public Tuple<string, DynamicParameters?> QueryToSql(Query query)
        {
            var param = new DynamicParameters(Compile(query).NamedBindings);
            return new Tuple<string, DynamicParameters?>(Compile(query).Sql, param);
        }
    }
}
